#include<stdio.h>
int ants=0;
void dfs(int kids,int kind1_left,int kind2_left)
{
	if(kids==7){
		if(kind1_left==0&&kind2_left==0){
			ants++;
			return;
		}
	}
	for(int c1=0;c1<=kind1_left;c1++){
		for(int c2=0;c2<=kind2_left;c2++){
			if((c1+c2)>=2&&(c1+c2)<=5){
				dfs(kids+1,kind1_left-c1,kind2_left-c2);
			}
		}
	}
}

int main()
{
	int a,b;
	scanf("%d %d",&a,&b);
	//printf("%d %d\n",a,b);
	dfs(0,a,b);
	printf("%d",ants);
	return 0;
}
